package com.masterclient.app.businessmodule.usermodule.login.dialog;

import android.view.View;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.masterclient.app.R;
import com.masterclient.app.businessmodule.usermodule.login.beans.InviterSelectPopModel;

/**
 * 作者：sean
 * 创建时间：2017/8/4 17:24
 * 功能说明：
 */
public class InviteAdapter extends BaseQuickAdapter<InviterSelectPopModel.SelectTypeBean, BaseViewHolder> {

    private OnClickItemListener onClickItemListener;

    InviteAdapter(OnClickItemListener onClickItemListener) {
        super(R.layout.item_invite);
        this.onClickItemListener = onClickItemListener;
    }

    @Override
    protected void convert(BaseViewHolder helper, InviterSelectPopModel.SelectTypeBean item) {
        View viewItem = helper.getView(R.id.view_item);
        TextView tvTitle = helper.getView(R.id.tv_title);
        tvTitle.setText(item.name);
        viewItem.setOnClickListener(view -> onClickItemListener.clickItem(item.type));
    }

    public interface OnClickItemListener{
        void clickItem(String type);
    }
}
